package com.flyduck.modules.schedule.task;

import com.flyduck.modules.system.mapper.SysLogMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @program: flyduck-admin
 * @description: 清理操作和登录日志
 * @author: flyduck
 * @create: 2020-06-17 14:01
 **/
@Component("clearLogTask")
@Slf4j
public class ClearLogTask implements ITask{

    @Autowired
    private SysLogMapper sysLogMapper;

    @Override
    public void run(String params) {
        log.info("开始清理操作和登录日志");
        //删除所有数据
        sysLogMapper.deleteAll();
        log.info("清理操作和登录日志成功");
    }
}
